const raw = {
  primary: [
    {
      url: "",
      name: "成果发布区",
      id: 11,
      color: "#CC9160",
    },
    {
      url: "",
      name: "J区",
      id: 12,
      color: "#DD7E6B",
    },
    {
      url: "",
      name: "K区",
      id: 13,
      color: "#80CE89",
    },
    {
      url: "",
      name: "L区",
      id: 14,
      color: "#916CE5",
    },
    {
      url: "",
      name: "M区",
      id: 15,
      color: "#BE7CCE",
    }
  ],
  secondary: [    
	{
      p_id: 12, //对应primary的id
      bgclr: "#ce5f49",
      data: [
        {
          xuhao: "J1",
          url: "",
          name: "XX展馆",
          id: 1,
        },{
          xuhao: "J2",
          url: "",
          name: "XX展馆",
          id: 2,
        },{
          xuhao: "J3",
          url: "",
          name: "XX展馆",
          id: 3,
        },{
          xuhao: "J4",
          url: "",
          name: "XX展馆",
          id: 4,
        },{
          xuhao: "J5",
          url: "",
          name: "XX展馆",
          id: 5,
        },{
          xuhao: "J6",
          url: "",
          name: "XX展馆",
          id: 6,
        },{
          xuhao: "J7",
          url: "",
          name: "XX展馆",
          id: 7,
        },{
          xuhao: "J8",
          url: "",
          name: "XX展馆",
          id: 8,
        },{
          xuhao: "J9",
          url: "",
          name: "XX展馆",
          id: 9,
        },{
          xuhao: "J10",
          url: "",
          name: "XX展馆",
          id: 10,
        },{
          xuhao: "J11",
          url: "",
          name: "XX展馆",
          id: 11,
        },{
          xuhao: "J12",
          url: "",
          name: "XX展馆",
          id: 12,
        },{
          xuhao: "J13",
          url: "",
          name: "XX展馆",
          id: 13,
        },{
          xuhao: "J14",
          url: "",
          name: "XX展馆",
          id: 14,
        },{
          xuhao: "J15",
          url: "",
          name: "XX展馆",
          id: 15,
        },{
          xuhao: "J16",
          url: "",
          name: "XX展馆",
          id: 16,
        },{
          xuhao: "J17",
          url: "",
          name: "XX展馆",
          id: 17,
        },{
          xuhao: "J18",
          url: "",
          name: "XX展馆",
          id: 18,
        },{
          xuhao: "J19",
          url: "",
          name: "XX展馆",
          id: 19,
        },{
          xuhao: "J20",
          url: "",
          name: "XX展馆",
          id: 20,
        },{
          xuhao: "J21",
          url: "",
          name: "XX展馆",
          id: 21,
        },{
          xuhao: "J22",
          url: "",
          name: "XX展馆",
          id: 22,
        },{
          xuhao: "J23",
          url: "",
          name: "XX展馆",
          id: 23,
        },{
          xuhao: "J24",
          url: "",
          name: "XX展馆",
          id: 24,
        },{
          xuhao: "J25",
          url: "",
          name: "XX展馆",
          id: 25,
        },{
          xuhao: "J26",
          url: "",
          name: "XX展馆",
          id: 26,
        },{
          xuhao: "J27",
          url: "",
          name: "XX展馆",
          id: 27,
        }
      ],
    },
    {
      p_id: 13, //对应primary的id
      bgclr: "#66af6c",
      data: [
        {
          xuhao: "K1",
          url: "",
          name: "XX展馆",
          id: 1,
        },{
          xuhao: "K2",
          url: "",
          name: "XX展馆",
          id: 2,
        },{
          xuhao: "K3",
          url: "",
          name: "XX展馆",
          id: 3,
        },{
          xuhao: "K4",
          url: "",
          name: "XX展馆",
          id: 4,
        },{
          xuhao: "K5",
          url: "",
          name: "XX展馆",
          id: 5,
        },{
          xuhao: "K6",
          url: "",
          name: "XX展馆",
          id: 6,
        },{
          xuhao: "K7",
          url: "",
          name: "XX展馆",
          id: 7,
        },{
          xuhao: "K8",
          url: "",
          name: "XX展馆",
          id: 8,
        },{
          xuhao: "K9",
          url: "",
          name: "XX展馆",
          id: 9,
        },{
          xuhao: "K10",
          url: "",
          name: "XX展馆",
          id: 10,
        },{
          xuhao: "K11",
          url: "",
          name: "XX展馆",
          id: 11,
        },{
          xuhao: "K12",
          url: "",
          name: "XX展馆",
          id: 12,
        },{
          xuhao: "K13",
          url: "",
          name: "XX展馆",
          id: 13,
        },{
          xuhao: "K14",
          url: "",
          name: "XX展馆",
          id: 14,
        },{
          xuhao: "K15",
          url: "",
          name: "XX展馆",
          id: 15,
        },{
          xuhao: "K16",
          url: "",
          name: "XX展馆",
          id: 16,
        },{
          xuhao: "K17",
          url: "",
          name: "XX展馆",
          id: 17,
        },{
          xuhao: "K18",
          url: "",
          name: "XX展馆",
          id: 18,
        }
      ],
    }, 
    {
      p_id: 14, //对应primary的id
      bgclr: "#794dde",
      data: [
        {
          xuhao: "L1",
          url: "",
          name: "XX展馆",
          id: 1,
        },{
          xuhao: "L2",
          url: "",
          name: "XX展馆",
          id: 2,
        },{
          xuhao: "L3",
          url: "",
          name: "XX展馆",
          id: 3,
        },{
          xuhao: "L4",
          url: "",
          name: "XX展馆",
          id: 4,
        },{
          xuhao: "L5",
          url: "",
          name: "XX展馆",
          id: 5,
        },{
          xuhao: "L6",
          url: "",
          name: "XX展馆",
          id: 6,
        },{
          xuhao: "L7",
          url: "",
          name: "XX展馆",
          id: 7,
        },{
          xuhao: "L8",
          url: "",
          name: "XX展馆",
          id: 8,
        },{
          xuhao: "L9",
          url: "",
          name: "XX展馆",
          id: 9,
        },{
          xuhao: "L10",
          url: "",
          name: "XX展馆",
          id: 10,
        },{
          xuhao: "L11",
          url: "",
          name: "XX展馆",
          id: 11,
        },{
          xuhao: "L12",
          url: "",
          name: "XX展馆",
          id: 12,
        },{
          xuhao: "L13",
          url: "",
          name: "XX展馆",
          id: 13,
        },{
          xuhao: "L14",
          url: "",
          name: "XX展馆",
          id: 14,
        },{
          xuhao: "L15",
          url: "",
          name: "XX展馆",
          id: 15,
        },{
          xuhao: "L16",
          url: "",
          name: "XX展馆",
          id: 16,
        },{
          xuhao: "L17",
          url: "",
          name: "XX展馆",
          id: 17,
        },{
          xuhao: "L18",
          url: "",
          name: "XX展馆",
          id: 18,
        },{
          xuhao: "L19",
          url: "",
          name: "XX展馆",
          id: 19,
        },{
          xuhao: "L20",
          url: "",
          name: "XX展馆",
          id: 20,
        }
      ],
    },
    {
      p_id: 15, //对应primary的id
      bgclr: "#b73ad4",
      data: [
        {
          xuhao: "M1",
          url: "",
          name: "XX展馆",
          id: 1,
        },{
          xuhao: "M2",
          url: "",
          name: "XX展馆",
          id: 2,
        },{
          xuhao: "M3",
          url: "",
          name: "XX展馆",
          id: 3,
        },{
          xuhao: "M4",
          url: "",
          name: "XX展馆",
          id: 4,
        },{
          xuhao: "M5",
          url: "",
          name: "XX展馆",
          id: 5,
        },{
          xuhao: "M6",
          url: "",
          name: "XX展馆",
          id: 6,
        },{
          xuhao: "M7",
          url: "",
          name: "XX展馆",
          id: 7,
        },{
          xuhao: "M8",
          url: "",
          name: "XX展馆",
          id: 8,
        },{
          xuhao: "M9",
          url: "",
          name: "XX展馆",
          id: 9,
        },{
          xuhao: "M10",
          url: "",
          name: "XX展馆",
          id: 10,
        },{
          xuhao: "M11",
          url: "",
          name: "XX展馆",
          id: 11,
        },{
          xuhao: "M12",
          url: "",
          name: "XX展馆",
          id: 12,
        },{
          xuhao: "M13",
          url: "",
          name: "XX展馆",
          id: 13,
        },{
          xuhao: "M14",
          url: "",
          name: "XX展馆",
          id: 14,
        },{
          xuhao: "M15",
          url: "",
          name: "XX展馆",
          id: 15,
        },{
          xuhao: "M16",
          url: "",
          name: "XX展馆",
          id: 16,
        },{
          xuhao: "M17",
          url: "",
          name: "XX展馆",
          id: 17,
        }
      ],
    },   
  ],
};

let loop = (main, sub) => {
  let data = main.map((item) => {
    sub.forEach((sub) => {
      if (item.id === sub.p_id) {
        item.sub = sub;
        item.show = false;
      }
    });
    return item;
  });

  return data;
};

let data = loop(raw.primary, raw.secondary);

module.exports = {
  data,
  raw,
};
